package com.codemate.interview.filter.bloom;

import cn.hutool.core.util.HashUtil;

/**
 * 默认Bloom过滤器，使用Java自带的Hash算法
 *
 * @author hice
 */
public class DefaultBloomFilter extends MetaAbstractBloomFilter {

    private static final long serialVersionUID = 1L;

    public DefaultBloomFilter(long maxValue, int machineNumber) {
        super(maxValue, machineNumber);
    }

    public DefaultBloomFilter(long maxValue) {
        super(maxValue);
    }

    @Override
    public long hash(String str) {
        return HashUtil.javaDefaultHash(str) % size;
    }
}
